package com.rwind.schema.config;

import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
import org.springframework.boot.diagnostics.FailureAnalysis;
import org.springframework.context.ApplicationContextException;
import org.springframework.stereotype.Component;

@Component
public class CustomFailureAnalyzer extends AbstractFailureAnalyzer<ApplicationContextException> {
    @Override
    protected FailureAnalysis analyze(Throwable rootFailure, ApplicationContextException cause) {
        String description = "The Spring Boot application failed to start properly.";
        String action = "Review the application logs for detailed error messages. Check for any exceptions during application context initialization, and ensure that all dependencies are properly configured.";
        return new FailureAnalysis(description, action, cause);
    }
}